Skip to content

Hole04#2

Open
Julesc002 wants to merge 5 commits into
mainfrom
hole04
Open

Hole04#2
Julesc002 wants to merge 5 commits into
mainfrom
hole04

Conversation

@Julesc002

Copy link
Copy Markdown
Owner

No description provided.

Comment thread src/12_RefactoringGolf/hole1/kata.ts Outdated
private _toto: Board = new Board();
private _board: Board = new Board();

private readonly playerO = 'O';

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Déplacer les constantes au dessus de la classe Game et passer de "private readonly" a "const"

Comment thread src/12_RefactoringGolf/hole1/kata.ts Outdated

//salut
export class Game {
private _lastSymbol = ' ';

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

donner a _lastSymbol la valeur de la constante emptyPlay

Comment thread src/12_RefactoringGolf/hole1/kata.ts Outdated

private validateFirstMove(player: string) {
if (this._lastSymbol == this.emptyPlay) {
if (player == this.playerO) {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

retirer les "this." car les constantes ne seront plus à l'intérieur de la classe

Comment thread src/12_RefactoringGolf/hole1/kata.ts Outdated
return this.emptyPlay;
}

private isFirstRowFull() {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changer la fonction isFirstRowFull en isRowFull(numéro row) pour éviter une duplication de code

  • supprimer les fonctions similaires qui deviendrons inutiles

De même pour isFirstRowFullWithSameSymbol à remplacer par isRowFullWithSameSymbol(numéro row)

  • supprimer les fonctions similaires qui deviendrons inutiles

Comment thread src/12_RefactoringGolf/hole1/kata.ts Outdated
) {
return this._toto.TileAt(0, 0)!.Symbol;
}
if (this.isFirstRowFull() && this.isFirstRowFullWithSameSymbol()) {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remplacer les appel a isFirstRowFull par isRowFull

  • Remplacer les appel a isFirstRowFullWithSameSymbol par isRowFullWithSameSymbol

Faire de même pour tous les numéros

- Déplacement des constantes au dessus de la classe Game et passage de "private readonly" a "const"
- _lastSymbol : passage de la valeur de la constante emptyPlay
-suppression des "this." pour les constantes
-refactoring des fonctions isRowFirst et isRowFullWithSameSymbol
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants